﻿@model IEnumerable<INTREPWEB.Models.Armador>

@{
    ViewBag.Title = "Index";

    if (IsAjax)
    {
        Layout = null;
    <script type="text/javascript" src="@Url.Content("~/Scripts/intrep-armador.js")" ></script>
    }   
}
@Html.Partial("_ToolBar")

@if (ViewBag.Vazio == null)
{
<table>
    <tr>
        <th>
            Armadores
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Ajax.ActionLink(item.Nome, "Editar", new { id = item.Id }, new AjaxOptions { OnBegin = "criaModal('editararmador')", UpdateTargetId = "editararmador", OnSuccess = "$.modalPopup('editararmador')" })
        </td>
        <td>
            @Ajax.ActionLink("x", "Deletar", new { id = item.Id }, new AjaxOptions { OnBegin = "criaModal('deletararmador')", UpdateTargetId = "deletararmador", OnSuccess = "$.modalPopup('deletararmador')" })
        </td>
    </tr>
}

</table>
}
else
{
        @Html.Partial("_SemItens")
}
